Repository navigation
refactor: extract extensible shared smoothing engine - #2452
changwangss wants to merge 11 commits into
Conversation
aac0d02 to
8e5e924
Compare
Signed-off-by: changwangss <chang1.wang@intel.com>
8e5e924 to
7d58d64
Compare
Signed-off-by: changwangss <chang1.wang@intel.com>
Signed-off-by: changwangss <chang1.wang@intel.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Three moderate issues remain in shared search and hook cleanup, along with a requested SVDQuant regression test.
No open issues 🎉
What changed in this PR
This refactor extracts a shared smoothing engine for AWQ and SVDQuant while preserving algorithm-specific behavior.
Changes:
- Adds shared smoothing groups, strategies, calibration, replay, search, and error handling.
- Migrates AWQ and SVDQuant workflows to the shared engine.
- Adds compatibility tests and synchronized documentation.
| File | Summary | Review notes |
|---|---|---|
test/unit/common/algorithms/test_svdquant.py |
SVDQuant compatibility tests | Reviewed |
test/unit/common/algorithms/test_svdquant_smooth.py |
SVDQuant smoothing tests | Reviewed |
test/unit/common/algorithms/test_svdquant_residual.py |
Residual tie behavior tests | Reviewed |
test/unit/common/algorithms/test_smoothing.py |
Shared smoothing utility tests | Reviewed |
test/unit/common/algorithms/test_smoothing_engine.py |
Extensible engine tests | Reviewed |
test/unit/common/algorithms/test_smoothing_awq_compatibility.py |
AWQ compatibility tests | Reviewed |
docs/svdquant_details.md |
English SVDQuant documentation | Reviewed |
docs/svdquant_details_CN.md |
Chinese SVDQuant documentation | Reviewed |
auto_round/algorithms/transforms/svdquant/smooth.py |
SVDQuant strategy and compatibility exports | Reviewed |
auto_round/algorithms/transforms/svdquant/smooth_adapters/base.py |
Shared group representation for SVDQuant | Reviewed |
auto_round/algorithms/transforms/svdquant/residual.py |
Residual tie preservation | Reviewed |
auto_round/algorithms/transforms/svdquant/apply.py |
Shared SVDQuant search and application | Nit (1): add a multi-group partial-installation regression test |
auto_round/algorithms/transforms/smoothing/search.py |
Shared candidate search | Moderate (1): support None candidates; retain the selected error alongside the candidate |
auto_round/algorithms/transforms/smoothing/scale.py |
Shared scale utilities | Reviewed |
auto_round/algorithms/transforms/smoothing/replay.py |
Hook replay and cleanup | Moderate (1): roll back partially installed hooks when registration fails |
auto_round/algorithms/transforms/smoothing/groups.py |
Shared smoothing groups | Reviewed |
auto_round/algorithms/transforms/smoothing/errors.py |
Shared smoothing errors | Reviewed |
auto_round/algorithms/transforms/smoothing/engine.py |
Shared smoothing engine | Reviewed |
auto_round/algorithms/transforms/smoothing/calibration.py |
Shared calibration utilities | Reviewed |
auto_round/algorithms/transforms/smoothing/__init__.py |
Shared smoothing exports | Reviewed |
auto_round/algorithms/transforms/awq/smooth.py |
AWQ smoothing strategy | Reviewed |
auto_round/algorithms/transforms/awq/base.py |
AWQ engine integration | Reviewed |
auto_round/algorithms/composer.py |
Hook and failure cleanup | Reviewed |
Review effort: Lite
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: changwangss <chang1.wang@intel.com>
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
base 9920194
from the awq details doc
|
Signed-off-by: changwangss <chang1.wang@intel.com>
Signed-off-by: changwangss <chang1.wang@intel.com>
Signed-off-by: changwangss <chang1.wang@intel.com>
Signed-off-by: changwangss <chang1.wang@intel.com>
Signed-off-by: changwangss <chang1.wang@intel.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open issues
Using object identity (is) to validate that aSmoothResultmatches aSmoothGroupis brittle:… · Newoutput_squared_error()documents a 'FP64 CPU accumulator' but does not enforce thataccumulator… · New The comment says this loop preserves the 'pre-extraction' search as a reference, but the selection… · New The comment says this loop preserves the 'pre-extraction' search as a reference, but the selection… · New
1 resolved since last review
Review effort: Lite
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: changwangss <chang1.wang@intel.com>
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |



Description
AWQ and SVDQuant maintain separate smoothing workflows. Extract an algorithm-independent
SmoothEngine,SmoothGroup, and structuralSmoothStrategyinterface, and route both algorithms through the shared engine. New algorithms supply preparation, candidates, scoring, application, and cleanup without adding algorithm branches to the engine.Preserve AWQ's activation/weight means, ratio/duo grid, QDQ loss, folding, and clipping synchronization; preserve SVDQuant's absmax statistics, Alpha/Beta grid, deployed-scale precision, and low-rank-aware scoring. Keep smoothing optional for SVDQuant and retain its search-all-groups-before-installation order. Existing configuration and SVDQuant smooth imports remain available.
Both algorithms now keep the first exact tie and share numerical-invalid candidate handling, logging, trial-state restoration, and cleanup. Execution errors, including OOM, propagate. AWQ retains its no-valid-candidate skip fallback; SVDQuant retains its error behavior. Joint AWQ + SVDQuant execution and broader model support remain follow-up work.
Type of Change
Refactor
Related Issues
Closes #2451
Validation
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1and--noconftestto isolate self-contained tests; this is not a full repository test run.Checklist Before Submitting